package com.aifast.system.sys.dao;

import com.aifast.system.sys.entity.SysUser;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 * 用户 Mapper 接口
 * </p>
 *
 * @author fujian
 * @since 2022-01-07
 */
@Mapper
public interface SysUserDao extends BaseMapper<SysUser>, MPJBaseMapper<SysUser> {

    Page<SysUser> list(String search, List<Integer> orgIds, Integer state, Integer roleId, Page page);

    /*@InterceptorIgnore(tenantLine = "true")
    default QueryWrapper<SysUser> getByUserNameAndPassword(String username, String password){
        return new QueryWrapper<SysUser>().eq("state",0).eq("username",username).eq("password",password);
    }*/

    @InterceptorIgnore(tenantLine = "true")
    SysUser getByUserNameAndPassword(String username, String password);

}
